﻿Public Class m_departamentos
    Inherits System.Web.UI.Page

   
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        'TextBox1.Enabled = False
        seguridad.verificapermisos()
    End Sub




    Protected Sub ImageButton4_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ImageButton4.Click
        ASPxGridViewExporter1.WritePdfToResponse()
    End Sub

    Protected Sub ImageButton5_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ImageButton5.Click
        ASPxGridViewExporter1.WriteXlsToResponse()
    End Sub

    Protected Sub ASPxButton1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ASPxButton1.Click
        Dim table As New DataSet1TableAdapters.departamentosTableAdapter

        Try
            table.InsertQuery(txtdescripcion.Text)
        Catch ex As Exception
            MsgBox("No se pudo ingresar al base de datos")
        End Try

        ASPxGridView2.DataBind()
        txtdescripcion.Text = ""
    End Sub

    Protected Sub ImageButton6_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ImageButton6.Click
        Dim sUrl As String = "frmdeparatmentos.aspx"
        Dim sScript As String = "<script language =javascript> "
        sScript += "window.open('" & sUrl & "',null,'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=500,height=300,left=100,top=100');"
        sScript += "</script> "
        Response.Write(sScript)
        Dim repot As New rptDepartamentos
        repot.DepartamentosTableAdapter.Fill(repot.DataSet11.departamentos)

    End Sub
End Class